package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution653 {
    public boolean findTarget(TreeNode root, int k) {
        return TreeUtils.findTarget(root, k);
    }
}

public class leetcode653 {
    public static void main(String[] args) {
        Solution653 solution653 = new Solution653();
        Integer[] nums = {5, 3, 6, 2, 4, null, 7};
        System.out.println(solution653.findTarget(TreeUtils.generateLeetcodeTree(nums), 9));
    }
}
